﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using SqlMiM.Common;


namespace SqlMiM.SqlServer.SpaceManagement
{
    public class Plugin : IPlugin
    {
        #region IPlugin Members

        private Guid identity = new Guid("15115453-B888-4a7e-95A6-10CA7F9BEB66");
        private View view;
        private ViewModel viewModel;
        private ImageSource icon;
        private IPluginGroup group;

        public Guid Identity
        {
            get
            {
                return identity;
            }
        }


        public IPluginGroup Group
        {
            get { return group; }
        }


        public string Name
        {
            get
            {
                return "Databases files sizes";
            }
        }

        public string Description
        {
            get
            {
                return "check spaces on all databases";
            }
        }

        public int Index
        {
            get
            {
                return 1;
            }
        }

        public UserControl Display
        {
            get
            {
                return view;
            }
        }

       


        public System.Windows.Input.Key Key
        {
            get
            {
                throw new NotImplementedException();
            }
        }

        public System.Windows.Media.ImageSource Icon
        {
            get
            {
                return this.icon;
            }
        }


        public Plugin(IPluginGroup group)
        {
            this.group = group;
            this.icon = new BitmapImage(new Uri("/SqlMiM.SqlServer;component/Images/chart_pie.png", UriKind.Relative)); ;

        }

        public void Activate()
        {
            this.view = new View();
            this.viewModel = new ViewModel();
            this.view.DataContext = this.viewModel;
        }

        public void Refresh()
        {
            this.viewModel.Load();
        }


        public void Deactivate()
        {
            this.view = null;
            this.viewModel = null;
        }

        public void Stop()
        {
        }

        #endregion


      
    }
}
